<?php
    header('Access-Control-Allow-Origin:*');
    header("content-type:text/html;charset=utf-8");
    if($_POST){
        $row_id = $_POST['id'];
        $row_name = $_POST['name'];
        $row_content = $_POST['content'];
        $row_version = $_POST['version'];
        $row_mtime = $_POST['m_time'];
        $db_con = mysqli_connect('localhost','root','');
        if($db_con){
            $result = mysqli_query($db_con,'set names utf8');
            $result = mysqli_query($db_con,'use sx_control');
            $sql = "update project set name='$row_name',content='$row_content',version='$row_version',m_time='$row_mtime' where id='$row_id'";
            $result = mysqli_query($db_con,$sql);
            $sql = "select * from project where id='$row_id'";
            $result = mysqli_query($db_con,$sql);
            $data = mysqli_fetch_assoc($result);        
            print_r($data);
            mysqli_close($db_con);
        } else {
            die ('数据库连接失败');
        }
    }
?>